const user = {
    index: true,
    border: true,
    selection: true,
    stripe: true,
    menuAlign: 'center',
    loadingText: "加载中...",
    loadingSpinner: "svg",
    loadingSvgViewBox: "-10, -10, 50, 50",
    loadingBackground: "rgba(122, 122, 122, 0.6)",
    labelWidth: 120,
    menu: true,
    menuWidth: 120,
    addBtn: false,
    delBtn: false,
    editBtn: false,
    column: [

        // userId
        {
            label: '用户ID',
            prop: "user_id",
            minWidth: 100,
            search: true
        },
        {
            label: "控制数量",
            prop: "point",
            minWidth: 100,
            search: true
        },
        {
            label: "动作",
            prop: "operator",
            minWidth: 100,
            search: true,
        },
        {
            label: "控制来源",
            prop: "game_code",
            minWidth: 100,
            search: true
        },
        {
            label: "备注",
            prop: "desc",
            minWidth: 100,
            search: true
        },
        {
            label: "操作时间",
            prop: "created_at",
            minWidth: 100,
            search: true,
            formatter: (row) => {
                const date = new Date(row.created_at * 1000);
                return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
            }
        },
        // {
        //     label: "当前状态",
        //     prop: "pass",
        //     minWidth: 100,
        //     search: true
        // },
        // {
        //     label: '当前金币',
        //     prop: "promoter",
        //     minWidth: 100,
        //     search: true
        // },
    ],
}

const formatDate = (date, cut) => {
    var date = new Date(date);
    var YY = date.getFullYear() + cut;
    var MM =
        (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + cut;
    var DD = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
    var hh = (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
    var mm = (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":";
    var ss = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
    return YY + MM + DD + " " + hh + mm + ss;
};

export default user